<?php

//require_once  __DIR__ . '/includes/authenticate.php';
include_once './db_bb_connect.php';

if (isset($_POST['playerID'])) {
	
	$playerID = $_POST['playerID'];

	$sql = "SELECT category, text 
	FROM attentionpointsplayers 
	WHERE playerID = '$playerID' 
	AND visibility = 'yes'";

	$result = $db->query($sql);

	if (mysqli_num_rows($result) > 0) {
  
		} else {
 		 echo "<br><br>no actionpoints found";
			}

	?>
<br><br>
<table class="table table-hover">
	<thead>
		
	</thead>
     <tbody>

   <?php while ($row = $result->fetch_assoc()) {
 			$text = $row['text'];
 			$category = $row['category']; ?>

      <tr>
        <td><strong><?= $category; ?></strong></td>
        <td><?= $text; ?></td>
      </tr>
 			
 	<?php	} ?>

 	    </tbody>
  </table>

  <?php


} else {
	echo "Wrong Request"; }




?>

